﻿package com.snakedickgames.common.rendering2D 
{
    import com.pblabs.rendering2D.DisplayObjectScene;
    import com.pblabs.rendering2D.DisplayObjectSceneLayer;
    
    // This class is unneeded as of PBE r886
    
    public class PluggableLayerScene extends DisplayObjectScene
    {
        public var layerOverrides:Array;
        
        override protected function generateLayer(layerIndex:int):DisplayObjectSceneLayer 
        {
            var outLayer:DisplayObjectSceneLayer;
            
            // Do we want a special layer?
            if (layerOverrides)
            {
                if (layerOverrides[layerIndex])
                {
                    outLayer = layerOverrides[layerIndex] as DisplayObjectSceneLayer;
                }
            }
            
            if (!outLayer)
                outLayer = super.generateLayer(layerIndex);
                
            return outLayer;
        }
    }

}